﻿package scenes
{
	import casts.audio.BGM;
	import casts.root.*;
	
	import jp.progression.commands.display.AddChild;
	import jp.progression.commands.display.AddChildAt;
	import jp.progression.scenes.SceneObject;
	
	import loading.DataLoading_1;
	import loading.SceneLoading;
	
	/**
	 * @author  cjboy1984@gmail.com
	 */
	public class _Root_sc extends SceneObject
	{
      // scene loading
      private var sc_loading:SceneLoading = new SceneLoading();
      // data loading
      private var data_loading:DataLoading_1 = new DataLoading_1();
      // bgm
      private var bgm:BGM = new BGM();
		// cast - 九宮格元件、背景、Floats
      // --- 左 上、中、下 --
      private var mcLeftTop:LeftTop = new LeftTop();
      private var mcLeftCenter:LeftCenter = new LeftCenter();
      private var mcLeftBottom:LeftBottom = new LeftBottom();
      // --- 中 上、中、下 --
      private var mcCenterTop:CenterTop = new CenterTop();
      private var mcCenterCenter:CenterCenter = new CenterCenter();
      private var mcCenterBottom:CenterBottom = new CenterBottom();
      // --- 右 上、中、下 --
      private var mcRightTop:RightTop = new RightTop();
      private var mcRightCenter:RightCenter = new RightCenter();
      private var mcRightBottom:RightBottom = new RightBottom();
      // --- 背景 ---
      private var mcBg1:Background1 = new Background1();

		public function _Root_sc()
		{
         addScene(new _Home_sc('home'));
         //addScene(new MySceneLoader('a.swf', 'a'));
		}

		// ################### protected ##################

		override protected function atSceneLoad():void
		{
         addCommand(
            [
               new AddChild(stage, bgm),
               new AddChildAt(stage, mcBg1, 0), // lower than container
               new AddChild(stage, mcLeftTop),
               new AddChild(stage, mcLeftCenter),
               new AddChild(stage, mcLeftCenter),
               new AddChild(stage, mcCenterTop),
               new AddChild(stage, mcCenterCenter),
               new AddChild(stage, mcCenterCenter),
               new AddChild(stage, mcRightTop),
               new AddChild(stage, mcRightCenter),
               new AddChild(stage, mcRightBottom)
            ]
         );
		}

		override protected function atSceneUnload():void {}
      override protected function atSceneInit():void {}
		override protected function atSceneGoto():void {}
      override protected function atSceneAscend():void {}
      override protected function atSceneDescend():void {}

      // #################### private ###################

      // --------------------- LINE ---------------------

	}

}
